# -*- coding: utf-8 -*-
"""
Created on Wed Feb  4 15:38:36 2015

@author: Tmoney
"""
# Tic Tac Toe Game
from Tkinter import *
from tkinter import Frame, Canvas, Label, Button, LEFT,RIGHT, ALL, Tk
from random import randint
import sys  #Imports system from computer.

#Import Tkinter as tk
master = Tk()
#-------( Title of Tk Window )-------
master.wm_title("Tmoney|Tic-Tac-Toe")
w = Canvas(master, width=300, height=300)      #Tkinter window size

#Essentials
w.pack()                   
frame = Frame(master)      
frame.pack()              
#w.bind("<Button-1>",master.callback)

# Quit Button
buttonQuit = Button(frame,text = 'Quit', command = master.destroy)
buttonQuit.pack()

# Pause Button
def toggle_pause():
    if pausebutton["text"] == "Pause":
        # switch to Unpause
        pausebutton["text"] = "Unpause"
    else:
        # reset to Pause
        pausebutton["text"] = "Pause"
pausebutton = Button( text="Pause",command=toggle_pause)
pausebutton.pack()


# Draws the Tic-Tac-Toe Board 3 x 3
Col1 = w.create_rectangle(0,0,300,300, outline="black")
Col2 = w.create_rectangle(100,300,200,0, outline="black")
Col3 = w.create_rectangle(0,100,300,200, outline="black")

 
class main:
   
    def __init__(self,master):
        self.frame = Frame(master)
        self.frame.pack(fill="both", expand=True)
        self.canvas = Canvas(self.frame, width=300, height=300)
        self.canvas.pack(fill="both", expand=True)
        self.label=Label(self.frame, text='Tic Tac Toe Game', height=6, bg='black', fg='blue')
        self.label.pack(fill="both", expand=True)
        self.frameb=Frame(self.frame)
        self.frameb.pack(fill="both", expand=True)
        self.Start1=Button(self.frameb, text='Click here to start\ndouble player', height=4, command=self.start1,bg='white', fg='purple')
        self.Start1.pack(fill="both", expand=True, side=RIGHT)
        self.Start2=Button(self.frameb, text='Click here to start\nsingle player', height=4, command=self.start2,bg='purple', fg='white')
        self.Start2.pack(fill="both", expand=True, side=LEFT)  
 
root=Tk()
app=main(root)
root.mainloop()






mainloop() #Without this...Tkinter window does not open

# Board in Console
def show(board):
    print board[0], '|',board[1], '|',board[2]
    print '----------'
    print board[3], '|',board[4], '|',board[5]
    print '----------'
    print board[6], '|',board[7], '|',board[8]


# The Game Board
board = [0,1,2,
         3,4,5,
         6,7,8]

show(board)    #Prints Board in Console     
         

    

    
#while True:

#User decides where he or she wants to draw.        
#    input = raw_input("Select your slot:")
 #   input = int(input)
    
# Win Paths
#w.create_line(0, 0, 300, 300, fill="red", dash=(4, 4))
#w.create_line(0, 300, 300, 0, fill="blue", dash=(4, 4))
#w.create_line(0, 150, 300, 150, fill="green", dash=(4, 4))
#w.create_line(150, 300, 150, 0, fill="green", dash=(4, 4))
